<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Capstone</title>
</head>
<body>
	Device Name: ${device.getDeviceName()}
	IP Address: ${device.getIpAddress()}
	
	<h2>Connected Devices</h2>
	<table>
		<c:forEach var="target" items="${targetDevices }">
			<tr>
				<td><form action="DeviceOverview" method="POST">
					<input type="submit" value=${target.getName() }/>
					<input type="hidden" name="targetIp" value="${target.getIp() }"/>
					<input type="hidden" name="targetUUID" value="${target.getUuid() }"/>
					<input type="hidden" name="hostIp" value="${device.getIpAddress() }"/>
					<input type="hidden" name="hostUUID" value="${device.getUUID() }"/>
				</form></td>
			</tr>
		</c:forEach>
	</table>
	
	<h2>Add Device</h2>
	<form action="PairDevices" method="POST">
		<table>
			<tr>
				<td>Pair Key:</td>
				<td><input type="text" name="pairKey"/></td>
			</tr>
			<tr>
				<td>Target IP:</td>
				<td><input type="text" name="targetIP"/></td>
			</tr>
		</table>
		<input type="hidden" name="uuid" value="${device.getUUID() }"/>
		<input type="submit" value="Connect Devices"/>
	</form>
</body>
</html>